/********************************************************************
	TABAL ENGINE - 2012/10/28
	author:		Marc Cuscullola
	
	purpose:	Math comparison functions
*********************************************************************/
#pragma once

#ifndef __MATH_COMPARE__INCLUDED_H__
#define __MATH_COMPARE__INCLUDED_H__

#include "MathTypes.h"
#include "Compare.inl"

namespace Math
{
namespace Compare
{
	/// Returns: 1 --> A is major, 0 --> are equal,  -1 --> A is minor
	template<typename TA, typename TB> inline int  Compare      (const TA& a, const TB& b, const TA epsilon = Epsilon<TA>());

	/// true if the magnitudes are equal with an error epsilon
	template<typename T>               inline bool EqualEpsilon (const T a, const T b, const T epsilon = Epsilon<T>());

	/// true if the magnitude is zero with an error tolerance
	template<typename T>               inline bool ZeroEpsilon  (const T a, const T epsilon = Epsilon<T>());

	/// The same as 'EqualEpsilon' but with a relative espilon to the magnitude
	template<typename T>               inline bool EqualRelatEpsilon (const T a, const T b, const T epsilon = Epsilon<T>());

	/// The same as 'ZeroEpsilon but with a relative epsilon to the magnitude
	template<typename T>               inline bool ZeroRelatEpsilon (const T a, const T epsilon = Epsilon<T>());

} //namespace Compare
} //namespace Math

#endif //__MATH_COMPARE__INCLUDED_H__

